-
Notifications
You must be signed in to change notification settings - Fork 60
box: box.New returns an error instead of panic #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch. See comments below.
Please, add an entry into the migration guide about the breaking change:
Line 7 in 6111b79
| TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A commit message should be well-formatted too:
50 chars max for a title line.
72 chars max for a message line.
box: box.New returns an error instead of panic
Method `box.New` now returns (*Box, error), because avoiding panics
entirely in third-party libraries is ideal, since we can't break
compatibility
Nonetheless, there is still a way to panic on error, via implemented
`box.MustNew` wrapper.
Closes #448
See:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message is bad-formatted. Should be:
Tests now use `box.MustNew` instead of `box.New`.
Added TestMocked_BoxNew for box.New creating a workable object
by means of checking length of Request[] in mockDoer after subrequest.
Closes #448
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, rewrite commit messages according the rules:
<=50 char for a title line
<= 72 chars for a message line
b031345 to
d839e4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, format the first commit correctly according to the rules:
box: box.New returns an error instead of panic
Method `box.New` now returns (*Box, error), because avoiding panics entirely in third-party libraries is ideal, since we can't break compatibility
Nonetheless, there is still a way to panic on error, via implemented `box.MustNew` wrapper.
Closes #448
->
box: box.New returns an error instead of panic
Method `box.New` now returns (*Box, error), because avoiding panics
entirely in third-party libraries is ideal, since we can't break
compatibility.
Nonetheless, there is still a way to panic on error, via implemented
`box.MustNew` wrapper.
Part of #448
And it should be Part of, not Closes since it is a not last commit in a sequence related to the issue.
Method `box.New` now returns (*Box, error), because avoiding panics entirely in third-party libraries is ideal, since we can't break compatibility. Nonetheless, there is still a way to panic on error, via implemented `box.MustNew` wrapper. Part of #448
Tests now use `box.MustNew` instead of `box.New`. Added TestMocked_BoxNew for box.New creating a workable object by means of checking length of Request[] in mockDoer after subrequest. Closes #448
d839e4c to
5490645
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch!
Method
box.Newnow returns(*Box, error), because avoiding panics entirely in third-party libraries is ideal, since we can't break compatibility.Nonetheless, there is still a way to panic on error, via implemented
box.MustNewwrapper.I didn't forget about (remove if it is not applicable):
Closes #448